package demo6;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        //
        AnnotationConfigApplicationContext context=
                new AnnotationConfigApplicationContext("demo6");
        Person person=context.getBean(Person.class);
        System.out.println(person);


        // 测试无注解的bean, 没有spring 自动注入类对象，因此输出为null
        Person p2=new Person();
        System.out.println(p2);

    }
}
